Skip to content

feat(metrics): add service operation to metrics label#7407

Open
dentiny wants to merge 1 commit intoapache:mainfrom
dentiny:hjiang/add-service-operation-label
Open

feat(metrics): add service operation to metrics label#7407
dentiny wants to merge 1 commit intoapache:mainfrom
dentiny:hjiang/add-service-operation-label

Conversation

@dentiny
Copy link
Copy Markdown
Contributor

@dentiny dentiny commented Apr 18, 2026

Which issue does this PR close?

Closes #7310

Rationale for this change

In production when using opendal, one big pain point is I don't have metrics aggregated by S3 HTTP request type.
In detail, multipart upload contains multiple types of requests: initiation, upload part, and completion; each type of request correspond to different server handling and displays different success rate and latency; current client side metrics doesn't provide us enough insight.

This PR adds certain label for HTTP request metrics.

What changes are included in this PR?

In the attached issue, I follow @Xuanwo's proposal to add an extension, similar to what do we do for operation label.

A few changes:

  • I add the HTTP request type to metrics, and support exporter for prometheus/fastmetrics/otelmetrics
  • I include the HTTP type in request extension, so it could be picked up at metrics layer

A few considerations

  • If certain storage backend doesn't support service operation, "unknown" will be used
  • The caveat is, for backends which don't support certain extension, (1) for prometheus exporter, metrics sent will contain larger payload; (2) little impact in terms of storage (time-series DB usually does dedup)
  • If the community is ok with the change, I plan to rollout the extension to all storage backends (if applicable)

Are there any user-facing changes?

No

AI Usage Statement

I used opus 4.6 to make most of the code change, and I'm responsible for code review/quality.

@dentiny dentiny requested a review from Xuanwo as a code owner April 18, 2026 02:38
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Apr 18, 2026
@dentiny dentiny force-pushed the hjiang/add-service-operation-label branch from cea9e7c to ff2ff3d Compare April 18, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: provide fine-grained HTTP request type

1 participant